home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus 2004 #11 / Amiga Plus CD - 2004 - No. 11.iso / AmiSoft / Dev / gg / perl-mos-diffs.lha / perl-5.6.1-diffs
Text File  |  2004-09-01  |  46KB  |  1,396 lines

  1. diff -ruN perl-5.6.1-orig/Configure perl-5.6.1/Configure
  2. --- perl-5.6.1-orig/Configure    Mon Mar 19 03:03:33 2001
  3. +++ perl-5.6.1/Configure    Sun Aug 29 16:25:58 2004
  4. @@ -7150,7 +7150,7 @@
  5.  case "$myhostname" in
  6.  '') cont=true
  7.      echo 'Maybe "hostname" will work...'
  8. -    if tans=`sh -c hostname 2>&1` ; then
  9. +    if tans=`/bin/sh -c hostname 2>&1` ; then
  10.          myhostname=$tans
  11.          phostname=hostname
  12.          cont=''
  13. @@ -7173,17 +7173,17 @@
  14.  fi
  15.  if $test "$cont"; then
  16.      echo 'No, maybe "uuname -l" will work...'
  17. -    if tans=`sh -c 'uuname -l' 2>&1` ; then
  18. +    if tans=`/bin/sh -c 'uuname -l' 2>&1` ; then
  19.          myhostname=$tans
  20.          phostname='uuname -l'
  21.      else
  22.          echo 'Strange.  Maybe "uname -n" will work...'
  23. -        if tans=`sh -c 'uname -n' 2>&1` ; then
  24. +        if tans=`/bin/sh -c 'uname -n' 2>&1` ; then
  25.              myhostname=$tans
  26.              phostname='uname -n'
  27.          else
  28.              echo 'Oh well, maybe I can mine it out of whoami.h...'
  29. -            if tans=`sh -c $contains' sysname $usrinc/whoami.h' 2>&1` ; then
  30. +            if tans=`/bin/sh -c $contains' sysname $usrinc/whoami.h' 2>&1` ; then
  31.                  myhostname=`echo "$tans" | $sed 's/^.*"\(.*\)"/\1/'`
  32.                  phostname="sed -n -e '"'/sysname/s/^.*\"\\(.*\\)\"/\1/{'"' -e p -e q -e '}' <$usrinc/whoami.h"
  33.              else
  34. diff -ruN perl-5.6.1-orig/README.morphos perl-5.6.1/README.morphos
  35. --- perl-5.6.1-orig/README.morphos    Thu Jan  1 00:00:00 1970
  36. +++ perl-5.6.1/README.morphos    Wed Sep  1 22:30:57 2004
  37. @@ -0,0 +1,95 @@
  38. +1. Introduction
  39. +---------------
  40. +This file describes particular issues on MorphOS port of Perl v5.6.1
  41. +
  42. +2. Requirements
  43. +---------------
  44. +No additional libraries and tools are needed to built Perl for MorphOS.
  45. +
  46. +3. Installation
  47. +---------------
  48. +Installation of the archive is simple. Just extract it into your GeekGadgets
  49. +tree.
  50. +
  51. +4. Usage
  52. +--------
  53. +Usage of Perl under MorphOS does not differ from any other system. Just note
  54. +that Perl is hungry for stack. On my system i use 327680 bytes long stack,
  55. +this seems to be enough. With 163840 bytes Perl produced hits during some
  56. +tests.
  57. +
  58. +It is recommended to read also "README.amiga" file. There you can find some
  59. +topics which are not covered by this document.
  60. +
  61. +5. Compiling
  62. +------------
  63. +To recompile Perl just cd to the directory with sources and type:
  64. +
  65. +        configure
  66. +
  67. +The script will ask you many questions, it is ok to give default answers. Of
  68. +course, you are free to play with those options, but i can't guarantee anything
  69. +in this case. To the last question ("Run make depend now?") answer "n".
  70. +
  71. +Unfortunately there are problems with PD Korn shell, which result in incorrect
  72. +behavour of "makedepend" script. To fix them you need to edit the script and
  73. +replace "$cat" everywhere in it with "/bin/cat".
  74. +
  75. +After that you can safely type:
  76. +
  77. +        make depend
  78. +
  79. +And when the process finishes you can enter:
  80. +
  81. +    make
  82. +
  83. +After compiling you may run test suite by typing:
  84. +
  85. +        make test
  86. +
  87. +On my system only one test fails - lib/findbin. This is a result of
  88. +ixemul.library's bug and not Perl's one. See detailed description in section 6.
  89. +
  90. +Install the compiled program by using:
  91. +
  92. +    make install.perl
  93. +        make install.man
  94. +
  95. +I use make v3.80 and it seems to have a bug because "make install" does not
  96. +work. Make just says that "Target install is up to date" and does nothing. If i
  97. +rename the target so something, for example "install1", it starts to work. So
  98. +you are free to try, may be you'll be more lucky.
  99. +
  100. +To clean up the distribution (erase all binary and #?.o files) you can use:
  101. +
  102. +    make distclean
  103. +
  104. +6. Known problems.
  105. +------------------
  106. +There are two known problems with this version of Perl on MorphOS. Both of them
  107. +are caused by bugs in ixemul.library version 49.7:
  108. +
  109. +- FindBin module will fail. The problem is that ixemul.library incorrectly
  110. +handles virtual filesystem root ("/"). You can't list it, examine entries in it
  111. +and even go to it from inner level (using "cd .."). FindBin module works by
  112. +traversing from current directory up to the root and then searching there. This
  113. +ixemul.library bug prevents it from functioning.
  114. +- This bug also prevented getcwd and fastcwd from Cwd module from functioning
  115. +because they use algorythm similar to FindBin. I've made a workaround for this
  116. +by redirecting those function to cwd which works normally. Hopefully this will
  117. +not cause any side effects.
  118. +- Second problem affects perlio I/O abstraction layer. It itself makes it
  119. +impossible to use FILE* contents. It is likely caused by bug in ungetc()
  120. +function of ixemul.library. As a workaround "d_stdstdio" parameter is set to
  121. +"undef" in hints/morphos.sh despite configure script suggests to "define" it. If
  122. +you choose to do so you'll get a lot of warnings like "Setting cnt to xxx
  123. +implies ptr yyy". This message means that values in FILE* are inconsistent. But
  124. +for Perl programs this should not cause any problems except I/O is a little
  125. +slower.
  126. +
  127. +7. Port author
  128. +---------
  129. +My name is Pavel Fedin, i live in Russia, and you can always reach me by
  130. +E-Mail:
  131. +
  132. +    sonic_amiga@rambler.ru
  133. diff -ruN perl-5.6.1-orig/bug.txt perl-5.6.1/bug.txt
  134. --- perl-5.6.1-orig/bug.txt    Thu Jan  1 00:00:00 1970
  135. +++ perl-5.6.1/bug.txt    Sun Aug 29 22:10:17 2004
  136. @@ -0,0 +1 @@
  137. +lib-findbin
  138. diff -ruN perl-5.6.1-orig/build.log perl-5.6.1/build.log
  139. --- perl-5.6.1-orig/build.log    Thu Jan  1 00:00:00 1970
  140. +++ perl-5.6.1/build.log    Thu Aug 19 21:43:30 2004
  141. @@ -0,0 +1,38 @@
  142. +`sh  cflags libperl.a miniperlmain.o`  miniperlmain.c
  143. +`sh  cflags libperl.a perl.o`  perl.c
  144. +`sh  cflags libperl.a gv.o`  gv.c
  145. +`sh  cflags libperl.a toke.o`  toke.c
  146. +`sh  cflags libperl.a perly.o`  perly.c
  147. +`sh  cflags libperl.a op.o`  op.c
  148. +`sh  cflags libperl.a regcomp.o`  regcomp.c
  149. +`sh  cflags libperl.a dump.o`  dump.c
  150. +`sh  cflags libperl.a util.o`  util.c
  151. +`sh  cflags libperl.a mg.o`  mg.c
  152. +`sh  cflags libperl.a hv.o`  hv.c
  153. +`sh  cflags libperl.a av.o`  av.c
  154. +`sh  cflags libperl.a run.o`  run.c
  155. +`sh  cflags libperl.a pp_hot.o`  pp_hot.c
  156. +`sh  cflags libperl.a sv.o`  sv.c
  157. +`sh  cflags libperl.a pp.o`  pp.c
  158. +`sh  cflags libperl.a scope.o`  scope.c
  159. +`sh  cflags libperl.a pp_ctl.o`  pp_ctl.c
  160. +`sh  cflags libperl.a pp_sys.o`  pp_sys.c
  161. +`sh  cflags libperl.a doop.o`  doop.c
  162. +`sh  cflags libperl.a doio.o`  doio.c
  163. +`sh  cflags libperl.a regexec.o`  regexec.c
  164. +`sh  cflags libperl.a utf8.o`  utf8.c
  165. +`sh  cflags libperl.a taint.o`  taint.c
  166. +`sh  cflags libperl.a deb.o`  deb.c
  167. +`sh  cflags libperl.a universal.o`  universal.c
  168. +`sh  cflags libperl.a xsutils.o`  xsutils.c
  169. +`sh  cflags libperl.a globals.o`  globals.c
  170. +`sh  cflags libperl.a perlio.o`  perlio.c
  171. +`sh  cflags libperl.a perlapi.o`  perlapi.c
  172. +rm -f libperl.a
  173. +/bin/ar rcu libperl.a perl.o  gv.o toke.o perly.o op.o regcomp.o dump.o util.o mg.o hv.o av.o run.o pp_hot.o sv.o pp.o scope.o pp_ctl.o pp_sys.o doop.o doio.o regexec.o utf8.o taint.o deb.o universal.o xsutils.o globals.o perlio.o perlapi.o 
  174. +rm -f opmini.c
  175. +cp op.c opmini.c
  176. +`sh  cflags libperl.a opmini.o`  -DPERL_EXTERNAL_GLOB opmini.c
  177. +rm -f opmini.c
  178. +gcc -L /gg/lib -lm -o miniperl \
  179. +    miniperlmain.o opmini.o libperl.a 
  180. diff -ruN perl-5.6.1-orig/hints/morphos.sh perl-5.6.1/hints/morphos.sh
  181. --- perl-5.6.1-orig/hints/morphos.sh    Thu Jan  1 00:00:00 1970
  182. +++ perl-5.6.1/hints/morphos.sh    Wed Sep  1 23:06:14 2004
  183. @@ -0,0 +1,54 @@
  184. +# hints/morphos.sh
  185. +#
  186. +# created by Pavel Fedin <sonic_amiga@rambler.ru> based on hints/amigaos.sh.
  187. +#
  188. +# misc stuff
  189. +archname='ppc-morphos'
  190. +cc='gcc'
  191. +firstmakefile='GNUmakefile'
  192. +usenm='true'
  193. +prefix='/gg'
  194. +
  195. +usemymalloc='n'
  196. +usevfork='true'
  197. +useperlio='true'
  198. +d_eofnblk='define'
  199. +d_fork='undef'
  200. +d_vfork='define'
  201. +groupstype='int'
  202. +
  203. +# libs
  204. +
  205. +libpth="$prefix/lib $prefix/ppc-morphos/lib"
  206. +glibpth="$libpth"
  207. +xlibpth="$libpth"
  208. +loclibpth="$prefix/lib"
  209. +
  210. +# This should remove unwanted libraries instead of limiting the set
  211. +# to just these few.  E.g. what about Berkeley DB?
  212. +libswanted='gdbm m dld'
  213. +so=' '
  214. +
  215. +# compiler & linker flags
  216. +# Respect command-line values.
  217. +
  218. +ccflags="$ccflags -DAMIGAOS -mstackextend"
  219. +case "$optimize" in
  220. +'') optimize='-O2 -fomit-frame-pointer';;
  221. +esac
  222. +dlext='o'
  223. +# Are these two different from the defaults?
  224. +cccdlflags='none'
  225. +ccdlflags='none'
  226. +lddlflags='-r'
  227. +
  228. +#Override ungetc() bug
  229. +d_stdstdio='undef'
  230. +
  231. +# MorphOS always reports only two links to directories, even if they
  232. +# contain subdirectories.  Consequently, we use this variable to stop
  233. +# File::Find using the link count to determine whether there are
  234. +# subdirectories to be searched.  This will generate a harmless message:
  235. +# Hmm...You had some extra variables I don't know about...I'll try to keep 'em.
  236. +#    Propagating recommended variable dont_use_nlink
  237. +dont_use_nlink='define'
  238. diff -ruN perl-5.6.1-orig/installman perl-5.6.1/installman
  239. --- perl-5.6.1-orig/installman    Fri Feb 23 02:57:55 2001
  240. +++ perl-5.6.1/installman    Wed Sep  1 22:52:39 2004
  241. @@ -147,7 +147,7 @@
  242.      # Convert name from  File/Basename.pm to File::Basename.3 format,
  243.      # if necessary.
  244.      $manpage =~ s#\.p(m|od)$##;
  245. -    if ($^O eq 'os2' || $^O eq 'amigaos' || $^O eq 'uwin' || $^O eq 'cygwin') {
  246. +    if ($^O eq 'os2' || $^O eq 'amigaos' || $^O eq 'morphos' || $^O eq 'uwin' || $^O eq 'cygwin') {
  247.        $manpage =~ s#/#.#g;
  248.      }
  249.      else {
  250. @@ -231,15 +231,18 @@
  251.      my($success) = 0;
  252.  
  253.      print $opts{verbose} ? "  ln $from $to\n" : "  $to\n" unless $opts{silent};
  254. -    eval {
  255. -        CORE::link($from, $to)
  256. -            ? $success++
  257. -            : ($from =~ m#^/afs/# || $to =~ m#^/afs/#)
  258. -              ? die "AFS"  # okay inside eval {}
  259. -              : warn "Couldn't link $from to $to: $!\n"
  260. -          unless $opts{notify};
  261. +    if ($^O ne 'morphos')
  262. +    {
  263. +        eval {
  264. +            CORE::link($from, $to)
  265. +                ? $success++
  266. +                : ($from =~ m#^/afs/# || $to =~ m#^/afs/#)
  267. +                  ? die "AFS"  # okay inside eval {}
  268. +                  : warn "Couldn't link $from to $to: $!\n"
  269. +              unless $opts{notify};
  270. +        };
  271.      };
  272. -    if ($@) {
  273. +    if ($@ || $^O eq 'morphos') {
  274.          File::Copy::copy($from, $to)
  275.              ? $success++
  276.              : warn "Couldn't copy $from to $to: $!\n"
  277. diff -ruN perl-5.6.1-orig/installperl perl-5.6.1/installperl
  278. --- perl-5.6.1-orig/installperl    Tue Mar 20 17:40:22 2001
  279. +++ perl-5.6.1/installperl    Thu Aug 19 23:00:35 2004
  280. @@ -163,8 +163,7 @@
  281.  
  282.     $installbin        || die "No installbin directory in config.sh\n";
  283.  -d $installbin        || mkpath($installbin, $verbose, 0777);
  284. --d $installbin        || $nonono || die "$installbin is not a directory\n";
  285. --w $installbin        || $nonono || die "$installbin is not writable by you\n"
  286. +-d $installbin        || $nonono || die "$installbin is not a directory\n"
  287.      unless $installbin =~ m#^/afs/# || $nonono;
  288.  
  289.  -x 'perl' . $exe_ext    || die "perl isn't executable!\n";
  290. @@ -539,7 +538,7 @@
  291.  
  292.      print $verbose ? "  ln $from $to\n" : "  $to\n" unless $silent;
  293.      eval {
  294. -    CORE::link($from, $to)
  295. +    CORE::symlink($from, $to)
  296.          ? $success++
  297.          : ($from =~ m#^/afs/# || $to =~ m#^/afs/#)
  298.            ? die "AFS"  # okay inside eval {}
  299. diff -ruN perl-5.6.1-orig/lib/Cwd.pm perl-5.6.1/lib/Cwd.pm
  300. --- perl-5.6.1-orig/lib/Cwd.pm    Sun Apr  1 09:00:22 2001
  301. +++ perl-5.6.1/lib/Cwd.pm    Thu Aug 26 23:09:03 2004
  302. @@ -106,6 +106,16 @@
  303.      else {
  304.      *cwd = \&getcwd;
  305.      }
  306. +# This is a quick workaround to get all functions working on MorphOS with
  307. +# broken "/" (root) handling in ixemul.library. I hope it really works
  308. +    if ($^O eq 'morphos') {
  309. +        *getcwd = \&_backtick_pwd;
  310. +        *fastcwd = \&_backtick_pwd;
  311. +    }
  312. +    else {
  313. +        *getcwd = \&_getcwd;
  314. +        *fastcwd = \&_fastcwd;
  315. +    }
  316.  }
  317.  
  318.  # set a reasonable (and very safe) default for fastgetcwd, in case it
  319. @@ -116,7 +126,7 @@
  320.  #
  321.  # Usage: $cwd = getcwd();
  322.  
  323. -sub getcwd
  324. +sub _getcwd
  325.  {
  326.      abs_path('.');
  327.  }
  328. @@ -128,7 +138,7 @@
  329.  # This is a faster version of getcwd.  It's also more dangerous because
  330.  # you might chdir out of a directory that you can't chdir back into.
  331.      
  332. -sub fastcwd {
  333. +sub _fastcwd {
  334.      my($odev, $oino, $cdev, $cino, $tdev, $tino);
  335.      my(@path, $path);
  336.      local(*DIR);
  337. diff -ruN perl-5.6.1-orig/lib/File/Basename.pm perl-5.6.1/lib/File/Basename.pm
  338. --- perl-5.6.1-orig/lib/File/Basename.pm    Fri Feb 23 02:57:55 2001
  339. +++ perl-5.6.1/lib/File/Basename.pm    Thu Aug 12 21:16:36 2004
  340. @@ -34,9 +34,9 @@
  341.  You select the syntax via the routine fileparse_set_fstype().
  342.  
  343.  If the argument passed to it contains one of the substrings
  344. -"VMS", "MSDOS", "MacOS", "AmigaOS" or "MSWin32", the file specification 
  345. -syntax of that operating system is used in future calls to 
  346. -fileparse(), basename(), and dirname().  If it contains none of
  347. +"VMS", "MSDOS", "MacOS", "AmigaOS", "MorphOS" or "MSWin32", the file
  348. +specification syntax of that operating system is used in future calls
  349. +to fileparse(), basename(), and dirname().  If it contains none of
  350.  these substrings, Unix syntax is used.  This pattern matching is
  351.  case-insensitive.  If you've selected VMS syntax, and the file
  352.  specification you pass to one of these routines contains a "/",
  353. @@ -44,10 +44,10 @@
  354.  rules instead, for that function call only.
  355.  
  356.  If the argument passed to it contains one of the substrings "VMS",
  357. -"MSDOS", "MacOS", "AmigaOS", "os2", "MSWin32" or "RISCOS", then the pattern
  358. -matching for suffix removal is performed without regard for case,
  359. -since those systems are not case-sensitive when opening existing files
  360. -(though some of them preserve case on file creation).
  361. +"MSDOS", "MacOS", "AmigaOS", "MorphOS", "os2", "MSWin32" or "RISCOS",
  362. +then the pattern matching for suffix removal is performed without
  363. +regard for case, since those systems are not case-sensitive when opening
  364. +existing files (though some of them preserve case on file creation).
  365.  
  366.  If you haven't called fileparse_set_fstype(), the syntax is chosen
  367.  by examining the builtin variable C<$^O> according to these rules.
  368. @@ -146,14 +146,14 @@
  369.  #   fileparse_set_fstype() - specify OS-based rules used in future
  370.  #                            calls to routines in this package
  371.  #
  372. -#   Currently recognized values: VMS, MSDOS, MacOS, AmigaOS, os2, RISCOS
  373. +#   Currently recognized values: VMS, MSDOS, MacOS, AmigaOS, MorphOS, os2, RISCOS
  374.  #       Any other name uses Unix-style rules and is case-sensitive
  375.  
  376.  sub fileparse_set_fstype {
  377.    my @old = ($Fileparse_fstype, $Fileparse_igncase);
  378.    if (@_) {
  379.      $Fileparse_fstype = $_[0];
  380. -    $Fileparse_igncase = ($_[0] =~ /^(?:MacOS|VMS|AmigaOS|os2|RISCOS|MSWin32|MSDOS)/i);
  381. +    $Fileparse_igncase = ($_[0] =~ /^(?:MacOS|VMS|AmigaOS|MorphOS|os2|RISCOS|MSWin32|MSDOS)/i);
  382.    }
  383.    wantarray ? @old : $old[0];
  384.  }
  385. @@ -183,7 +183,7 @@
  386.    elsif ($fstype =~ /^MacOS/si) {
  387.      ($dirpath,$basename) = ($fullname =~ /^(.*:)?(.*)/s);
  388.    }
  389. -  elsif ($fstype =~ /^AmigaOS/i) {
  390. +  elsif ($fstype =~ /^(?:AmigaOS|MorphOS)/i) {
  391.      ($dirpath,$basename) = ($fullname =~ /(.*[:\/])?(.*)/s);
  392.      $dirpath = './' unless $dirpath;
  393.    }
  394. @@ -261,7 +261,7 @@
  395.          $dirname =~ s/([^:])[\\\/]*\z/$1/;
  396.      }
  397.      }
  398. -    elsif ($fstype =~ /AmigaOS/i) {
  399. +    elsif ($fstype =~ /(?:AmigaOS|MorphOS)/i) {
  400.          if ( $dirname =~ /:\z/) { return $dirname }
  401.          chop $dirname;
  402.          $dirname =~ s#[^:/]+\z## unless length($basename);
  403. diff -ruN perl-5.6.1-orig/lib/File/Find.pm perl-5.6.1/lib/File/Find.pm
  404. --- perl-5.6.1-orig/lib/File/Find.pm    Fri Feb 23 02:57:55 2001
  405. +++ perl-5.6.1/lib/File/Find.pm    Thu Aug 26 22:34:00 2004
  406. @@ -758,7 +758,7 @@
  407.  }
  408.  
  409.  $File::Find::dont_use_nlink = 1
  410. -    if $^O eq 'os2' || $^O eq 'dos' || $^O eq 'amigaos' || $^O eq 'MSWin32' ||
  411. +    if $^O eq 'os2' || $^O eq 'dos' || $^O eq 'amigaos' || $^O eq 'morphos' || $^O eq 'MSWin32' ||
  412.         $^O eq 'cygwin' || $^O eq 'epoc';
  413.  
  414.  # Set dont_use_nlink in your hint file if your system's stat doesn't
  415. diff -ruN perl-5.6.1-orig/lib/File/Path.pm perl-5.6.1/lib/File/Path.pm
  416. --- perl-5.6.1-orig/lib/File/Path.pm    Tue Mar 20 17:40:22 2001
  417. +++ perl-5.6.1/lib/File/Path.pm    Thu Aug 12 21:17:52 2004
  418. @@ -107,7 +107,7 @@
  419.  # These OSes complain if you want to remove a file that you have no
  420.  # write permission to:
  421.  my $force_writeable = ($^O eq 'os2' || $^O eq 'dos' || $^O eq 'MSWin32' ||
  422. -               $^O eq 'amigaos' || $^O eq 'MacOS' || $^O eq 'epoc');
  423. +               $^O eq 'amigaos' || $^O eq 'morphos' || $^O eq 'MacOS' || $^O eq 'epoc');
  424.  
  425.  sub mkpath {
  426.      my($paths, $verbose, $mode) = @_;
  427. diff -ruN perl-5.6.1-orig/lib/File/Spec/MorphOS.pm perl-5.6.1/lib/File/Spec/MorphOS.pm
  428. --- perl-5.6.1-orig/lib/File/Spec/MorphOS.pm    Thu Jan  1 00:00:00 1970
  429. +++ perl-5.6.1/lib/File/Spec/MorphOS.pm    Sun Aug 29 19:24:41 2004
  430. @@ -0,0 +1,458 @@
  431. +package File::Spec::MorphOS;
  432. +
  433. +use strict;
  434. +use vars qw($VERSION);
  435. +
  436. +$VERSION = '1.2';
  437. +
  438. +use Cwd;
  439. +
  440. +=head1 NAME
  441. +
  442. +File::Spec::Unix - methods used by File::Spec
  443. +
  444. +=head1 SYNOPSIS
  445. +
  446. + require File::Spec::Unix; # Done automatically by File::Spec
  447. +
  448. +=head1 DESCRIPTION
  449. +
  450. +Methods for manipulating file specifications.
  451. +
  452. +=head1 METHODS
  453. +
  454. +=over 2
  455. +
  456. +=item canonpath
  457. +
  458. +No physical check on the filesystem, but a logical cleanup of a
  459. +path. On UNIX eliminated successive slashes and successive "/.".
  460. +
  461. +    $cpath = File::Spec->canonpath( $path ) ;
  462. +
  463. +=cut
  464. +
  465. +sub canonpath {
  466. +    my ($self,$path) = @_;
  467. +    $path =~ s|/+|/|g unless($^O eq 'cygwin');     # xx////xx  -> xx/xx
  468. +    $path =~ s|(/\.)+/|/|g;                        # xx/././xx -> xx/xx
  469. +    $path =~ s|^(\./)+||s unless $path eq "./";    # ./xx      -> xx
  470. +    $path =~ s|^/(\.\./)+|/|s;                     # /../../xx -> xx
  471. +    $path =~ s|/\Z(?!\n)|| unless $path eq "/";          # xx/       -> xx
  472. +    return $path;
  473. +}
  474. +
  475. +=item catdir
  476. +
  477. +Concatenate two or more directory names to form a complete path ending
  478. +with a directory. But remove the trailing slash from the resulting
  479. +string, because it doesn't look good, isn't necessary and confuses
  480. +OS2. Of course, if this is the root directory, don't cut off the
  481. +trailing slash :-)
  482. +
  483. +=cut
  484. +
  485. +sub catdir {
  486. +    my $self = shift;
  487. +    my @args = @_;
  488. +    foreach (@args) {
  489. +    # append a slash to each argument unless it has one there
  490. +    $_ .= "/" if $_ eq '' || substr($_,-1) ne "/";
  491. +    }
  492. +    return $self->canonpath(join('', @args));
  493. +}
  494. +
  495. +=item catfile
  496. +
  497. +Concatenate one or more directory names and a filename to form a
  498. +complete path ending with a filename
  499. +
  500. +=cut
  501. +
  502. +sub catfile {
  503. +    my $self = shift;
  504. +    my $file = pop @_;
  505. +    return $file unless @_;
  506. +    my $dir = $self->catdir(@_);
  507. +    $dir .= "/" unless substr($dir,-1) eq "/";
  508. +    return $dir.$file;
  509. +}
  510. +
  511. +=item curdir
  512. +
  513. +Returns a string representation of the current directory.  "." on UNIX.
  514. +
  515. +=cut
  516. +
  517. +sub curdir {
  518. +    return ".";
  519. +}
  520. +
  521. +=item devnull
  522. +
  523. +Returns a string representation of the null device. "/dev/null" on UNIX.
  524. +
  525. +=cut
  526. +
  527. +sub devnull {
  528. +    return "/dev/null";
  529. +}
  530. +
  531. +=item rootdir
  532. +
  533. +Returns a string representation of the root directory.  "/" on UNIX.
  534. +
  535. +=cut
  536. +
  537. +sub rootdir {
  538. +    return "/";
  539. +}
  540. +
  541. +=item tmpdir
  542. +
  543. +Returns a string representation of the first writable directory
  544. +from the following list or "" if none are writable:
  545. +
  546. +    $ENV{TMPDIR}
  547. +    /tmp
  548. +
  549. +=cut
  550. +
  551. +my $tmpdir;
  552. +sub tmpdir {
  553. +    return $tmpdir if defined $tmpdir;
  554. +    foreach ($ENV{TMPDIR}, "/tmp") {
  555. +    next unless defined;
  556. +    $tmpdir = $_;
  557. +    last;
  558. +    }
  559. +    $tmpdir = '' unless defined $tmpdir;
  560. +    return $tmpdir;
  561. +}
  562. +
  563. +=item updir
  564. +
  565. +Returns a string representation of the parent directory.  ".." on MorphOS.
  566. +
  567. +=cut
  568. +
  569. +sub updir {
  570. +    return "..";
  571. +}
  572. +
  573. +=item no_upwards
  574. +
  575. +Given a list of file names, strip out those that refer to a parent
  576. +directory. (Does not strip symlinks, only '.', '..', and equivalents.)
  577. +
  578. +=cut
  579. +
  580. +sub no_upwards {
  581. +    my $self = shift;
  582. +    return grep(!/^\.{1,2}\Z(?!\n)/s, @_);
  583. +}
  584. +
  585. +=item case_tolerant
  586. +
  587. +Returns a true or false value indicating, respectively, that alphabetic
  588. +is not or is significant when comparing file specifications.
  589. +
  590. +=cut
  591. +
  592. +sub case_tolerant {
  593. +    return 0;
  594. +}
  595. +
  596. +=item file_name_is_absolute
  597. +
  598. +Takes as argument a path and returns true if it is an absolute path.
  599. +
  600. +This does not consult the local filesystem on Unix, Win32, or OS/2.  It
  601. +does sometimes on MacOS (see L<File::Spec::MacOS/file_name_is_absolute>).
  602. +It does consult the working environment for VMS (see
  603. +L<File::Spec::VMS/file_name_is_absolute>).
  604. +
  605. +=cut
  606. +
  607. +sub file_name_is_absolute {
  608. +    my ($self,$file) = @_;
  609. +    return scalar($file =~ m:^/:s);
  610. +}
  611. +
  612. +=item path
  613. +
  614. +Takes no argument, returns the environment variable PATH as an array.
  615. +
  616. +=cut
  617. +
  618. +sub path {
  619. +    my @path = split(':', $ENV{PATH});
  620. +    foreach (@path) { $_ = '.' if $_ eq '' }
  621. +    return @path;
  622. +}
  623. +
  624. +=item join
  625. +
  626. +join is the same as catfile.
  627. +
  628. +=cut
  629. +
  630. +sub join {
  631. +    my $self = shift;
  632. +    return $self->catfile(@_);
  633. +}
  634. +
  635. +=item splitpath
  636. +
  637. +    ($volume,$directories,$file) = File::Spec->splitpath( $path );
  638. +    ($volume,$directories,$file) = File::Spec->splitpath( $path, $no_file );
  639. +
  640. +Splits a path in to volume, directory, and filename portions. On systems
  641. +with no concept of volume, returns undef for volume. 
  642. +
  643. +For systems with no syntax differentiating filenames from directories, 
  644. +assumes that the last file is a path unless $no_file is true or a 
  645. +trailing separator or /. or /.. is present. On Unix this means that $no_file
  646. +true makes this return ( '', $path, '' ).
  647. +
  648. +The directory portion may or may not be returned with a trailing '/'.
  649. +
  650. +The results can be passed to L</catpath()> to get back a path equivalent to
  651. +(usually identical to) the original path.
  652. +
  653. +=cut
  654. +
  655. +sub splitpath {
  656. +    my ($self,$path, $nofile) = @_;
  657. +
  658. +    my ($volume,$directory,$file) = ('','','');
  659. +
  660. +    if ( $nofile ) {
  661. +        $directory = $path;
  662. +    }
  663. +    else {
  664. +        $path =~ m|^ ( (?: .* / (?: \.\.?\Z(?!\n) )? )? ) ([^/]*) |xs;
  665. +        $directory = $1;
  666. +        $file      = $2;
  667. +    }
  668. +
  669. +    return ($volume,$directory,$file);
  670. +}
  671. +
  672. +
  673. +=item splitdir
  674. +
  675. +The opposite of L</catdir()>.
  676. +
  677. +    @dirs = File::Spec->splitdir( $directories );
  678. +
  679. +$directories must be only the directory portion of the path on systems 
  680. +that have the concept of a volume or that have path syntax that differentiates
  681. +files from directories.
  682. +
  683. +Unlike just splitting the directories on the separator, empty
  684. +directory names (C<''>) can be returned, because these are significant
  685. +on some OSs (e.g. MacOS).
  686. +
  687. +On Unix,
  688. +
  689. +    File::Spec->splitdir( "/a/b//c/" );
  690. +
  691. +Yields:
  692. +
  693. +    ( '', 'a', 'b', '', 'c', '' )
  694. +
  695. +=cut
  696. +
  697. +sub splitdir {
  698. +    my ($self,$directories) = @_ ;
  699. +    #
  700. +    # split() likes to forget about trailing null fields, so here we
  701. +    # check to be sure that there will not be any before handling the
  702. +    # simple case.
  703. +    #
  704. +    if ( $directories !~ m|/\Z(?!\n)| ) {
  705. +        return split( m|/|, $directories );
  706. +    }
  707. +    else {
  708. +        #
  709. +        # since there was a trailing separator, add a file name to the end, 
  710. +        # then do the split, then replace it with ''.
  711. +        #
  712. +        my( @directories )= split( m|/|, "${directories}dummy" ) ;
  713. +        $directories[ $#directories ]= '' ;
  714. +        return @directories ;
  715. +    }
  716. +}
  717. +
  718. +
  719. +=item catpath
  720. +
  721. +Takes volume, directory and file portions and returns an entire path. Under
  722. +Unix, $volume is ignored, and directory and file are catenated.  A '/' is
  723. +inserted if need be.  On other OSs, $volume is significant.
  724. +
  725. +=cut
  726. +
  727. +sub catpath {
  728. +    my ($self,$volume,$directory,$file) = @_;
  729. +
  730. +    if ( $directory ne ''                && 
  731. +         $file ne ''                     && 
  732. +         substr( $directory, -1 ) ne '/' && 
  733. +         substr( $file, 0, 1 ) ne '/' 
  734. +    ) {
  735. +        $directory .= "/$file" ;
  736. +    }
  737. +    else {
  738. +        $directory .= $file ;
  739. +    }
  740. +
  741. +    return $directory ;
  742. +}
  743. +
  744. +=item abs2rel
  745. +
  746. +Takes a destination path and an optional base path returns a relative path
  747. +from the base path to the destination path:
  748. +
  749. +    $rel_path = File::Spec->abs2rel( $path ) ;
  750. +    $rel_path = File::Spec->abs2rel( $path, $base ) ;
  751. +
  752. +If $base is not present or '', then L<cwd()> is used. If $base is relative, 
  753. +then it is converted to absolute form using L</rel2abs()>. This means that it
  754. +is taken to be relative to L<cwd()>.
  755. +
  756. +On systems with the concept of a volume, this assumes that both paths 
  757. +are on the $destination volume, and ignores the $base volume. 
  758. +
  759. +On systems that have a grammar that indicates filenames, this ignores the 
  760. +$base filename as well. Otherwise all path components are assumed to be
  761. +directories.
  762. +
  763. +If $path is relative, it is converted to absolute form using L</rel2abs()>.
  764. +This means that it is taken to be relative to L<cwd()>.
  765. +
  766. +No checks against the filesystem are made on most systems.  On MacOS,
  767. +the filesystem may be consulted (see
  768. +L<File::Spec::MacOS/file_name_is_absolute>).  On VMS, there is
  769. +interaction with the working environment, as logicals and
  770. +macros are expanded.
  771. +
  772. +Based on code written by Shigio Yamaguchi.
  773. +
  774. +=cut
  775. +
  776. +sub abs2rel {
  777. +    my($self,$path,$base) = @_;
  778. +
  779. +    # Clean up $path
  780. +    if ( ! $self->file_name_is_absolute( $path ) ) {
  781. +        $path = $self->rel2abs( $path ) ;
  782. +    }
  783. +    else {
  784. +        $path = $self->canonpath( $path ) ;
  785. +    }
  786. +
  787. +    # Figure out the effective $base and clean it up.
  788. +    if ( !defined( $base ) || $base eq '' ) {
  789. +        $base = cwd() ;
  790. +    }
  791. +    elsif ( ! $self->file_name_is_absolute( $base ) ) {
  792. +        $base = $self->rel2abs( $base ) ;
  793. +    }
  794. +    else {
  795. +        $base = $self->canonpath( $base ) ;
  796. +    }
  797. +
  798. +    # Now, remove all leading components that are the same
  799. +    my @pathchunks = $self->splitdir( $path);
  800. +    my @basechunks = $self->splitdir( $base);
  801. +
  802. +    while (@pathchunks && @basechunks && $pathchunks[0] eq $basechunks[0]) {
  803. +        shift @pathchunks ;
  804. +        shift @basechunks ;
  805. +    }
  806. +
  807. +    $path = CORE::join( '/', @pathchunks );
  808. +    $base = CORE::join( '/', @basechunks );
  809. +
  810. +    # $base now contains the directories the resulting relative path 
  811. +    # must ascend out of before it can descend to $path_directory.  So, 
  812. +    # replace all names with $parentDir
  813. +    $base =~ s|[^/]+|..|g ;
  814. +
  815. +    # Glue the two together, using a separator if necessary, and preventing an
  816. +    # empty result.
  817. +    if ( $path ne '' && $base ne '' ) {
  818. +        $path = "$base/$path" ;
  819. +    } else {
  820. +        $path = "$base$path" ;
  821. +    }
  822. +
  823. +    return $self->canonpath( $path ) ;
  824. +}
  825. +
  826. +=item rel2abs
  827. +
  828. +Converts a relative path to an absolute path. 
  829. +
  830. +    $abs_path = File::Spec->rel2abs( $path ) ;
  831. +    $abs_path = File::Spec->rel2abs( $path, $base ) ;
  832. +
  833. +If $base is not present or '', then L<cwd()> is used. If $base is relative, 
  834. +then it is converted to absolute form using L</rel2abs()>. This means that it
  835. +is taken to be relative to L<cwd()>.
  836. +
  837. +On systems with the concept of a volume, this assumes that both paths 
  838. +are on the $base volume, and ignores the $path volume. 
  839. +
  840. +On systems that have a grammar that indicates filenames, this ignores the 
  841. +$base filename as well. Otherwise all path components are assumed to be
  842. +directories.
  843. +
  844. +If $path is absolute, it is cleaned up and returned using L</canonpath()>.
  845. +
  846. +No checks against the filesystem are made on most systems.  On MacOS,
  847. +the filesystem may be consulted (see
  848. +L<File::Spec::MacOS/file_name_is_absolute>).  On VMS, there is
  849. +interaction with the working environment, as logicals and
  850. +macros are expanded.
  851. +
  852. +Based on code written by Shigio Yamaguchi.
  853. +
  854. +=cut
  855. +
  856. +sub rel2abs {
  857. +    my ($self,$path,$base ) = @_;
  858. +
  859. +    # Clean up $path
  860. +    if ( ! $self->file_name_is_absolute( $path ) ) {
  861. +        # Figure out the effective $base and clean it up.
  862. +        if ( !defined( $base ) || $base eq '' ) {
  863. +            $base = cwd() ;
  864. +        }
  865. +        elsif ( ! $self->file_name_is_absolute( $base ) ) {
  866. +            $base = $self->rel2abs( $base ) ;
  867. +        }
  868. +        else {
  869. +            $base = $self->canonpath( $base ) ;
  870. +        }
  871. +
  872. +        # Glom them together
  873. +        $path = $self->catdir( $base, $path ) ;
  874. +    }
  875. +
  876. +    return $self->canonpath( $path ) ;
  877. +}
  878. +
  879. +
  880. +=back
  881. +
  882. +=head1 SEE ALSO
  883. +
  884. +L<File::Spec>
  885. +
  886. +=cut
  887. +
  888. +1;
  889. diff -ruN perl-5.6.1-orig/lib/File/Spec/Unix.pm perl-5.6.1/lib/File/Spec/Unix.pm
  890. --- perl-5.6.1-orig/lib/File/Spec/Unix.pm    Fri Feb 23 02:57:55 2001
  891. +++ perl-5.6.1/lib/File/Spec/Unix.pm    Sun Aug 29 18:49:03 2004
  892. @@ -122,6 +122,10 @@
  893.  sub tmpdir {
  894.      return $tmpdir if defined $tmpdir;
  895.      foreach ($ENV{TMPDIR}, "/tmp") {
  896. +        print "Checking ",$_,"\n";
  897. +        print defined,"\n";
  898. +        print -d,"\n";
  899. +        print -w,"\n";
  900.      next unless defined && -d && -w _;
  901.      $tmpdir = $_;
  902.      last;
  903. diff -ruN perl-5.6.1-orig/lib/File/Spec.pm perl-5.6.1/lib/File/Spec.pm
  904. --- perl-5.6.1-orig/lib/File/Spec.pm    Fri Feb 23 02:57:55 2001
  905. +++ perl-5.6.1/lib/File/Spec.pm    Sun Aug 29 18:52:29 2004
  906. @@ -9,7 +9,8 @@
  907.            MSWin32 => 'Win32',
  908.            os2     => 'OS2',
  909.            VMS     => 'VMS',
  910. -          epoc    => 'Epoc');
  911. +          epoc    => 'Epoc',
  912. +              morphos => 'MorphOS');
  913.  
  914.  my $module = $module{$^O} || 'Unix';
  915.  require "File/Spec/$module.pm";
  916. diff -ruN perl-5.6.1-orig/lib/File/Temp.pm perl-5.6.1/lib/File/Temp.pm
  917. --- perl-5.6.1-orig/lib/File/Temp.pm    Sat Mar  3 19:53:20 2001
  918. +++ perl-5.6.1/lib/File/Temp.pm    Sun Aug 29 21:36:20 2004
  919. @@ -404,9 +404,11 @@
  920.      ${$options{ErrStr}} = "Parent directory ($parent) is not a directory";
  921.      return ();
  922.    }
  923. -  unless (-w _) {
  924. -    ${$options{ErrStr}} = "Parent directory ($parent) is not writable\n";
  925. -      return ();
  926. +  if ($^O ne 'morphos') {
  927. +    unless (-w _) {
  928. +      ${$options{ErrStr}} = "Parent directory ($parent) is not writable\n";
  929. +        return ();
  930. +    }
  931.    }
  932.  
  933.  
  934. @@ -649,14 +651,17 @@
  935.    # Check to see whether owner is neither superuser (or a system uid) nor me
  936.    # Use the real uid from the $< variable
  937.    # UID is in [4]
  938. -  if ($info[4] > File::Temp->top_system_uid() && $info[4] != $<) {
  939. -
  940. -    Carp::cluck(sprintf "uid=$info[4] topuid=%s \$<=$< path='$path'",
  941. -        File::Temp->top_system_uid());
  942. -
  943. -    $$err_ref = "Directory owned neither by root nor the current user"
  944. -      if ref($err_ref);
  945. -    return 0;
  946. +  if ($^O ne 'amigaos' && $^O ne 'morphos')
  947. +  {
  948. +     if ($info[4] > File::Temp->top_system_uid() && $info[4] != $<) {
  949. +
  950. +       Carp::cluck(sprintf "uid=$info[4] topuid=%s \$<=$< path='$path'",
  951. +              File::Temp->top_system_uid());
  952. +
  953. +       $$err_ref = "Directory owned neither by root nor the current user"
  954. +         if ref($err_ref);
  955. +       return 0;
  956. +     }
  957.    }
  958.  
  959.    # check whether group or other can write file
  960. diff -ruN perl-5.6.1-orig/lib/Term/ReadLine.pm perl-5.6.1/lib/Term/ReadLine.pm
  961. --- perl-5.6.1-orig/lib/Term/ReadLine.pm    Fri Feb 23 02:57:55 2001
  962. +++ perl-5.6.1/lib/Term/ReadLine.pm    Thu Aug 12 21:21:06 2004
  963. @@ -197,7 +197,7 @@
  964.      $console = "sys\$command";
  965.      }
  966.  
  967. -    if (($^O eq 'amigaos') || ($^O eq 'beos') || ($^O eq 'epoc')) {
  968. +    if (($^O eq 'amigaos') || ($^O eq 'morphos') || ($^O eq 'beos') || ($^O eq 'epoc')) {
  969.      $console = undef;
  970.      }
  971.      elsif ($^O eq 'os2') {
  972. diff -ruN perl-5.6.1-orig/lib/perl5db.pl perl-5.6.1/lib/perl5db.pl
  973. --- perl-5.6.1-orig/lib/perl5db.pl    Fri Feb 23 02:57:55 2001
  974. +++ perl-5.6.1/lib/perl5db.pl    Thu Aug 12 21:02:18 2004
  975. @@ -2510,7 +2510,7 @@
  976.  }
  977.  
  978.  sub setman { 
  979. -    $doccmd = $^O !~ /^(?:MSWin32|VMS|os2|dos|amigaos|riscos|MacOS)\z/s
  980. +    $doccmd = $^O !~ /^(?:MSWin32|VMS|os2|dos|amigaos|morphos|riscos|MacOS)\z/s
  981.          ? "man"             # O Happy Day!
  982.          : "perldoc";        # Alas, poor unfortunates
  983.  }
  984. diff -ruN perl-5.6.1-orig/t/io/fs.t perl-5.6.1/t/io/fs.t
  985. --- perl-5.6.1-orig/t/io/fs.t    Sat Mar  3 19:53:20 2001
  986. +++ perl-5.6.1/t/io/fs.t    Wed Aug 25 21:48:35 2004
  987. @@ -12,6 +12,8 @@
  988.  $Is_Dosish = ($^O eq 'MSWin32' or $^O eq 'dos' or
  989.            $^O eq 'os2' or $^O eq 'mint');
  990.  
  991. +$No_Link = ($Is_Dosish || $^O eq 'morphos');
  992. +
  993.  if (defined &Win32::IsWinNT && Win32::IsWinNT()) {
  994.      $Is_Dosish = '' if Win32::FsType() eq 'NTFS';
  995.  }
  996. @@ -35,24 +37,24 @@
  997.  open(fh,'>a') || die "Can't create a";
  998.  close(fh);
  999.  
  1000. -if ($Is_Dosish) {print "ok 2 # skipped: no link\n";} 
  1001. +if ($No_Link) {print "ok 2 # skipped: no link\n";}
  1002.  elsif (eval {link('a','b')}) {print "ok 2\n";} 
  1003.  else {print "not ok 2\n";}
  1004.  
  1005. -if ($Is_Dosish) {print "ok 3 # skipped: no link\n";} 
  1006. +if ($No_Link) {print "ok 3 # skipped: no link\n";}
  1007.  elsif (eval {link('b','c')}) {print "ok 3\n";} 
  1008.  else {print "not ok 3\n";}
  1009.  
  1010.  ($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,$atime,$mtime,$ctime,
  1011.      $blksize,$blocks) = stat('c');
  1012.  
  1013. -if ($Config{dont_use_nlink} || $Is_Dosish)
  1014. +if ($Config{dont_use_nlink} || $No_Link)
  1015.      {print "ok 4 # skipped: no link\n";} 
  1016.  elsif ($nlink == 3)
  1017.      {print "ok 4\n";} 
  1018.  else {print "not ok 4\n";}
  1019.  
  1020. -if ($^O eq 'amigaos' || $Is_Dosish)
  1021. +if ($^O eq 'amigaos' || $No_Link)
  1022.      {print "ok 5 # skipped: no link\n";} 
  1023.  elsif (($mode & 0777) == 0666)
  1024.      {print "ok 5\n";} 
  1025. @@ -63,7 +65,7 @@
  1026.  
  1027.  ($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,$atime,$mtime,$ctime,
  1028.      $blksize,$blocks) = stat('c');
  1029. -if ($Is_Dosish) {print "ok 7 # skipped: no link\n";} 
  1030. +if ($No_Link) {print "ok 7 # skipped: no link\n";}
  1031.  elsif (($mode & 0777) == $newmode) {print "ok 7\n";} 
  1032.  else {print "not ok 7\n";}
  1033.  
  1034. @@ -73,23 +75,23 @@
  1035.      $newmode = 0666;
  1036.  }
  1037.  
  1038. -if ($Is_Dosish) {print "ok 8 # skipped: no link\n";} 
  1039. +if ($No_Link) {print "ok 8 # skipped: no link\n";}
  1040.  elsif ((chmod $newmode,'c','x') == 2) {print "ok 8\n";} 
  1041.  else {print "not ok 8\n";}
  1042.  
  1043.  ($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,$atime,$mtime,$ctime,
  1044.      $blksize,$blocks) = stat('c');
  1045. -if ($Is_Dosish) {print "ok 9 # skipped: no link\n";} 
  1046. +if ($No_Link) {print "ok 9 # skipped: no link\n";}
  1047.  elsif (($mode & 0777) == $newmode) {print "ok 9\n";} 
  1048.  else {print "not ok 9\n";}
  1049.  
  1050.  ($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,$atime,$mtime,$ctime,
  1051.      $blksize,$blocks) = stat('x');
  1052. -if ($Is_Dosish) {print "ok 10 # skipped: no link\n";} 
  1053. +if ($No_Link) {print "ok 10 # skipped: no link\n";}
  1054.  elsif (($mode & 0777) == $newmode) {print "ok 10\n";} 
  1055.  else {print "not ok 10\n";}
  1056.  
  1057. -if ($Is_Dosish) {print "ok 11 # skipped: no link\n"; unlink 'b','x'; } 
  1058. +if ($No_Link) {print "ok 11 # skipped: no link\n"; unlink 'b','x'; }
  1059.  elsif ((unlink 'b','x') == 2) {print "ok 11\n";} 
  1060.  else {print "not ok 11\n";}
  1061.  ($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,$atime,$mtime,$ctime,
  1062. @@ -111,7 +113,7 @@
  1063.      $blksize,$blocks) = stat('b');
  1064.  if ($^O eq 'MSWin32') { print "ok 17 # skipped: bogus (stat)[1]\n"; }
  1065.  elsif ($ino) {print "ok 17\n";} else {print "not ok 17\n";}
  1066. -if ($wd =~ m#/afs/# || $^O eq 'amigaos' || $^O eq 'dos' || $^O eq 'MSWin32')
  1067. +if ($wd =~ m#/afs/# || $^O eq 'amigaos' || $^O eq 'morphos' || $^O eq 'dos' || $^O eq 'MSWin32')
  1068.      {print "ok 18 # skipped: granularity of the filetime\n";}
  1069.  elsif ($atime == 500000000 && $mtime == 500000000 + $delta)
  1070.      {print "ok 18\n";}
  1071. diff -ruN perl-5.6.1-orig/t/lib/anydbm.t perl-5.6.1/t/lib/anydbm.t
  1072. --- perl-5.6.1-orig/t/lib/anydbm.t    Fri Feb 23 02:57:57 2001
  1073. +++ perl-5.6.1/t/lib/anydbm.t    Thu Aug 12 21:24:03 2004
  1074. @@ -16,7 +16,7 @@
  1075.  
  1076.  print "1..12\n";
  1077.  
  1078. -$Is_Dosish = ($^O eq 'amigaos' || $^O eq 'MSWin32' or $^O eq 'dos' or
  1079. +$Is_Dosish = ($^O eq 'amigaos' || $^O eq 'morphos' || $^O eq 'MSWin32' or $^O eq 'dos' or
  1080.            $^O eq 'os2' or $^O eq 'mint');
  1081.  
  1082.  unlink <Op_dbmx*>;
  1083. diff -ruN perl-5.6.1-orig/t/lib/db-btree.t perl-5.6.1/t/lib/db-btree.t
  1084. --- perl-5.6.1-orig/t/lib/db-btree.t    Fri Feb 23 02:57:57 2001
  1085. +++ perl-5.6.1/t/lib/db-btree.t    Thu Aug 12 21:24:30 2004
  1086. @@ -142,7 +142,7 @@
  1087.  
  1088.  my ($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,$atime,$mtime,$ctime,
  1089.     $blksize,$blocks) = stat($Dfile);
  1090. -ok(20, ($mode & 0777) == ($^O eq 'os2' ? 0666 : 0640) || $^O eq 'amigaos' || $^O eq 'MSWin32');
  1091. +ok(20, ($mode & 0777) == ($^O eq 'os2' ? 0666 : 0640) || $^O eq 'amigaos' || $^O eq 'morphos' || $^O eq 'MSWin32');
  1092.  
  1093.  my ($key, $value, $i);
  1094.  while (($key,$value) = each(%h)) {
  1095. diff -ruN perl-5.6.1-orig/t/lib/db-hash.t perl-5.6.1/t/lib/db-hash.t
  1096. --- perl-5.6.1-orig/t/lib/db-hash.t    Fri Feb 23 02:57:57 2001
  1097. +++ perl-5.6.1/t/lib/db-hash.t    Thu Aug 12 21:27:31 2004
  1098. @@ -108,7 +108,7 @@
  1099.  
  1100.  my ($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,$atime,$mtime,$ctime,
  1101.     $blksize,$blocks) = stat($Dfile);
  1102. -ok(16, ($mode & 0777) == ($^O eq 'os2' ? 0666 : 0640) || $^O eq 'amigaos' || $^O eq 'MSWin32');
  1103. +ok(16, ($mode & 0777) == ($^O eq 'os2' ? 0666 : 0640) || $^O eq 'amigaos' || $^O eq 'morphos' || $^O eq 'MSWin32');
  1104.  
  1105.  my ($key, $value, $i);
  1106.  while (($key,$value) = each(%h)) {
  1107. diff -ruN perl-5.6.1-orig/t/lib/db-recno.t perl-5.6.1/t/lib/db-recno.t
  1108. --- perl-5.6.1-orig/t/lib/db-recno.t    Fri Feb 23 02:57:57 2001
  1109. +++ perl-5.6.1/t/lib/db-recno.t    Thu Aug 12 21:27:15 2004
  1110. @@ -153,7 +153,7 @@
  1111.  ok(17, $X = tie @h, 'DB_File', $Dfile, O_RDWR|O_CREAT, 0640, $DB_RECNO ) ;
  1112.  
  1113.  ok(18, ((stat($Dfile))[2] & 0777) == ($^O eq 'os2' ? 0666 : 0640)
  1114. -    ||  $^O eq 'MSWin32' || $^O eq 'amigaos') ;
  1115. +    ||  $^O eq 'MSWin32' || $^O eq 'amigaos' || $^O eq 'morphos') ;
  1116.  
  1117.  #my $l = @h ;
  1118.  my $l = $X->length ;
  1119. diff -ruN perl-5.6.1-orig/t/lib/filehand.t perl-5.6.1/t/lib/filehand.t
  1120. --- perl-5.6.1-orig/t/lib/filehand.t    Tue Mar 20 17:40:22 2001
  1121. +++ perl-5.6.1/t/lib/filehand.t    Thu Aug 12 21:26:59 2004
  1122. @@ -72,7 +72,7 @@
  1123.  
  1124.  ($rd,$wr) = FileHandle::pipe;
  1125.  
  1126. -if ($^O eq 'VMS' || $^O eq 'os2' || $^O eq 'amigaos' || $^O eq 'MSWin32' ||
  1127. +if ($^O eq 'VMS' || $^O eq 'os2' || $^O eq 'amigaos' || $^O eq 'morphos' || $^O eq 'MSWin32' ||
  1128.      $Config{d_fork} ne 'define') {
  1129.    $wr->autoflush;
  1130.    $wr->printf("ok %d\n",11);
  1131. diff -ruN perl-5.6.1-orig/t/lib/ftmp-tempfile.t perl-5.6.1/t/lib/ftmp-tempfile.t
  1132. --- perl-5.6.1-orig/t/lib/ftmp-tempfile.t    Fri Feb 23 02:57:57 2001
  1133. +++ perl-5.6.1/t/lib/ftmp-tempfile.t    Sun Aug 29 21:27:44 2004
  1134. @@ -42,10 +42,10 @@
  1135.  # Now we start the tests properly
  1136.  ok(1);
  1137.  
  1138. -
  1139.  # Tempfile
  1140.  # Open tempfile in some directory, unlink at end
  1141.  my ($fh, $tempfile) = tempfile(
  1142. +                               DIR => '/tmp',
  1143.                     UNLINK => 1,
  1144.                     SUFFIX => '.txt',
  1145.                    );
  1146. @@ -125,8 +125,7 @@
  1147.  #    on NFS
  1148.  # Try to do what we can.
  1149.  # Tempfile croaks on error so we need an eval
  1150. -$fh = eval { tempfile( 'ftmpXXXXX', DIR => File::Spec->tmpdir ) };
  1151. -
  1152. +($fh, $tempfile) = eval { tempfile( 'ftmpXXXXX', DIR => File::Spec->tmpdir ) };
  1153.  if ($fh) {
  1154.  
  1155.    # print something to it to make sure something is there
  1156. diff -ruN perl-5.6.1-orig/t/lib/gdbm.t perl-5.6.1/t/lib/gdbm.t
  1157. --- perl-5.6.1-orig/t/lib/gdbm.t    Mon Mar 19 08:10:30 2001
  1158. +++ perl-5.6.1/t/lib/gdbm.t    Thu Aug 12 21:26:13 2004
  1159. @@ -29,7 +29,7 @@
  1160.  if (! -e $Dfile) {
  1161.      ($Dfile) = <Op.dbmx*>;
  1162.  }
  1163. -if ($^O eq 'amigaos' || $^O eq 'os2' || $^O eq 'MSWin32' || $^O eq 'dos') {
  1164. +if ($^O eq 'amigaos' || $^O eq 'morphos' || $^O eq 'os2' || $^O eq 'MSWin32' || $^O eq 'dos') {
  1165.      print "ok 2 # Skipped: different file permission semantics\n";
  1166.  }
  1167.  else {
  1168. diff -ruN perl-5.6.1-orig/t/lib/glob-basic.t perl-5.6.1/t/lib/glob-basic.t
  1169. --- perl-5.6.1-orig/t/lib/glob-basic.t    Mon Apr  2 05:18:41 2001
  1170. +++ perl-5.6.1/t/lib/glob-basic.t    Fri Aug 27 01:03:31 2004
  1171. @@ -79,7 +79,7 @@
  1172.  # check bad protections
  1173.  # should return an empty list, and set ERROR
  1174.  if ($^O eq 'mpeix' or $^O eq 'MSWin32' or $^O eq 'os2' or $^O eq 'VMS'
  1175. -    or $^O eq 'cygwin' or Cwd::cwd() =~ m#^/afs#s or not $>)
  1176. +    or $^O eq 'cygwin' or $^O eq 'morphos' or Cwd::cwd() =~ m#^/afs#s or not $>)
  1177.  {
  1178.      print "ok 6 # skipped\n";
  1179.  }
  1180. @@ -89,6 +89,7 @@
  1181.      @a = bsd_glob("$dir/*", GLOB_ERR);
  1182.      #print "\@a = ", array(@a);
  1183.      rmdir $dir;
  1184. +    print scalar(@a)," ",GLOB_ERROR,"\n";
  1185.      if (scalar(@a) != 0 || GLOB_ERROR == 0) {
  1186.      print "not ";
  1187.      }
  1188. @@ -110,7 +111,6 @@
  1189.  # Working on t/TEST often causes this test to fail because it sees temp
  1190.  # and RCS files.  Filter them out, and .pm files too.
  1191.  @a = grep !/(,v$|~$|\.pm$)/, @a;
  1192. -
  1193.  unless (@a == 3
  1194.          and $a[0] eq ($^O eq 'VMS'? 'test.' : 'TEST')
  1195.          and $a[1] eq 'a'
  1196. diff -ruN perl-5.6.1-orig/t/lib/ipc_sysv.t perl-5.6.1/t/lib/ipc_sysv.t
  1197. --- perl-5.6.1-orig/t/lib/ipc_sysv.t    Fri Feb 23 02:57:57 2001
  1198. +++ perl-5.6.1/t/lib/ipc_sysv.t    Fri Aug 27 00:08:32 2004
  1199. @@ -16,6 +16,9 @@
  1200.      } elsif ($Config{'d_msg'} ne 'define') {
  1201.        $reason = '$Config{d_msg} undefined';
  1202.      }
  1203. +    if ($^O eq 'amigaos' || $^O eq 'morphos') {
  1204. +      $reason = 'Not supported on this system';
  1205. +    }
  1206.      if ($reason) {
  1207.      print "1..0 # Skip: $reason\n";
  1208.      exit 0;
  1209. diff -ruN perl-5.6.1-orig/t/lib/ndbm.t perl-5.6.1/t/lib/ndbm.t
  1210. --- perl-5.6.1-orig/t/lib/ndbm.t    Mon Mar 19 08:10:30 2001
  1211. +++ perl-5.6.1/t/lib/ndbm.t    Thu Aug 12 21:25:52 2004
  1212. @@ -40,7 +40,7 @@
  1213.  if (! -e $Dfile) {
  1214.      ($Dfile) = <Op.dbmx*>;
  1215.  }
  1216. -if ($^O eq 'amigaos' || $^O eq 'os2' || $^O eq 'MSWin32') {
  1217. +if ($^O eq 'amigaos' || $^O eq 'morphos' || $^O eq 'os2' || $^O eq 'MSWin32') {
  1218.      print "ok 2 # Skipped: different file permission semantics\n";
  1219.  }
  1220.  else {
  1221. diff -ruN perl-5.6.1-orig/t/lib/odbm.t perl-5.6.1/t/lib/odbm.t
  1222. --- perl-5.6.1-orig/t/lib/odbm.t    Mon Mar 19 08:10:30 2001
  1223. +++ perl-5.6.1/t/lib/odbm.t    Thu Aug 12 21:25:28 2004
  1224. @@ -40,7 +40,7 @@
  1225.  if (! -e $Dfile) {
  1226.      ($Dfile) = <Op.dbmx*>;
  1227.  }
  1228. -if ($^O eq 'amigaos' || $^O eq 'os2' || $^O eq 'MSWin32') {
  1229. +if ($^O eq 'amigaos' || $^O eq 'morphos' || $^O eq 'os2' || $^O eq 'MSWin32') {
  1230.      print "ok 2 # Skipped: different file permission semantics\n";
  1231.  }
  1232.  else {
  1233. diff -ruN perl-5.6.1-orig/t/lib/sdbm.t perl-5.6.1/t/lib/sdbm.t
  1234. --- perl-5.6.1-orig/t/lib/sdbm.t    Mon Mar 19 08:10:30 2001
  1235. +++ perl-5.6.1/t/lib/sdbm.t    Thu Aug 12 21:25:04 2004
  1236. @@ -40,7 +40,7 @@
  1237.  if (! -e $Dfile) {
  1238.      ($Dfile) = <Op_dbmx.*>;
  1239.  }
  1240. -if ($^O eq 'amigaos' || $^O eq 'os2' || $^O eq 'MSWin32' || $^O eq 'dos') {
  1241. +if ($^O eq 'amigaos' || $^O eq 'morphos' || $^O eq 'os2' || $^O eq 'MSWin32' || $^O eq 'dos') {
  1242.      print "ok 2 # Skipped: different file permission semantics\n";
  1243.  }
  1244.  else {
  1245. diff -ruN perl-5.6.1-orig/t/op/grent.t perl-5.6.1/t/op/grent.t
  1246. --- perl-5.6.1-orig/t/op/grent.t    Fri Feb 23 02:57:58 2001
  1247. +++ perl-5.6.1/t/op/grent.t    Wed Aug 25 22:35:50 2004
  1248. @@ -42,11 +42,15 @@
  1249.      }
  1250.  
  1251.      if (not defined $where) {    # Try local.
  1252. -    my $GR = "/etc/group";
  1253. -    if (-f $GR && open(GR, $GR) && defined(<GR>)) {
  1254. -        undef $reason;
  1255. -        $where = $GR;
  1256. -    }
  1257. +    if ($^O eq 'amigaos' || $^O eq 'morphos') {
  1258. +            $reason = 'Unable to handle /etc/group on AmigaOS, please fix me';
  1259. +        } else {
  1260. +            my $GR = "/etc/group";
  1261. +            if (-f $GR && open(GR, $GR) && defined(<GR>)) {
  1262. +            undef $reason;
  1263. +            $where = $GR;
  1264. +        }
  1265. +        }
  1266.      }
  1267.      if ($reason) {
  1268.      print "1..0 # Skip: $reason\n";
  1269. diff -ruN perl-5.6.1-orig/t/op/pwent.t perl-5.6.1/t/op/pwent.t
  1270. --- perl-5.6.1-orig/t/op/pwent.t    Sun Apr  8 06:09:16 2001
  1271. +++ perl-5.6.1/t/op/pwent.t    Wed Aug 25 22:20:22 2004
  1272. @@ -42,10 +42,14 @@
  1273.      }
  1274.  
  1275.      if (not defined $where) {    # Try local.
  1276. -    my $PW = "/etc/passwd";
  1277. -    if (-f $PW && open(PW, $PW) && defined(<PW>)) {
  1278. -        $where = $PW;
  1279. -        undef $reason;
  1280. +        if ($^O eq 'amigaos' || $^O eq 'morphos') {
  1281. +            $reason = 'Unable to handle /etc/passwd on AmigaOS, please fix me';
  1282. +        } else {
  1283. +            my $PW = "/etc/passwd";
  1284. +            if (-f $PW && open(PW, $PW) && defined(<PW>)) {
  1285. +            $where = $PW;
  1286. +            undef $reason;
  1287. +            }
  1288.      }
  1289.      }
  1290.  
  1291. diff -ruN perl-5.6.1-orig/t/op/stat.t perl-5.6.1/t/op/stat.t
  1292. --- perl-5.6.1-orig/t/op/stat.t    Mon Mar 19 07:33:17 2001
  1293. +++ perl-5.6.1/t/op/stat.t    Wed Aug 25 22:37:44 2004
  1294. @@ -13,11 +13,12 @@
  1295.  
  1296.  $Is_MSWin32 = $^O eq 'MSWin32';
  1297.  $Is_Dos = $^O eq 'dos';
  1298. +$Is_Amiga = $^O eq 'amigaos' || $^O eq 'morphos';
  1299.  $Is_Dosish = $Is_Dos || $^O eq 'os2' || $Is_MSWin32;
  1300.  $Is_Cygwin = $^O eq 'cygwin';
  1301.  chop($cwd = ($Is_MSWin32 ? `cd` : `pwd`));
  1302.  
  1303. -$DEV = `ls -l /dev` unless $Is_Dosish or $Is_Cygwin;
  1304. +$DEV = `ls -l /dev` unless $Is_Dosish or $Is_Cygwin or $Is_Amiga;
  1305.  
  1306.  unlink "Op.stat.tmp";
  1307.  if (open(FOO, ">Op.stat.tmp")) {
  1308. @@ -52,7 +53,7 @@
  1309.    print "# open failed: $!\nnot ok 1\nnot ok 2\n";
  1310.  }
  1311.  
  1312. -if ($Is_Dosish) { unlink "Op.stat.tmp2"}
  1313. +if ($Is_Dosish || $^O eq 'morphos') { unlink "Op.stat.tmp2"}
  1314.  else {
  1315.      `rm -f Op.stat.tmp2;ln Op.stat.tmp Op.stat.tmp2; chmod 644 Op.stat.tmp`;
  1316.  }
  1317. @@ -60,7 +61,7 @@
  1318.  ($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,$atime,$mtime,$ctime,
  1319.      $blksize,$blocks) = stat('Op.stat.tmp');
  1320.  
  1321. -if ($Is_Dosish || $Config{dont_use_nlink})
  1322. +if ($Is_Dosish || $Config{dont_use_nlink} || $^O eq 'morphos')
  1323.      {print "ok 3 # skipped: no link count\n";} 
  1324.  elsif ($nlink == 2)
  1325.      {print "ok 3\n";} 
  1326. @@ -70,7 +71,8 @@
  1327.          # Solaris tmpfs bug
  1328.      || ($cwd =~ m#^/tmp# and $mtime && $mtime==$ctime && $^O eq 'solaris')
  1329.      || $cwd =~ m#/afs/#
  1330. -    || $^O eq 'amigaos') {
  1331. +    || $^O eq 'amigaos'
  1332. +        || $^O eq 'morphos') {
  1333.      print "ok 4 # skipped: different semantic of mtime/ctime\n";
  1334.  }
  1335.  elsif (   ($mtime && $mtime != $ctime)  ) {
  1336. @@ -141,7 +143,7 @@
  1337.  unlink 'Op.stat.tmp2';
  1338.  if (! -e 'Op.stat.tmp2') {print "ok 28\n";} else {print "not ok 28\n";}
  1339.  
  1340. -if ($Is_MSWin32 || $Is_Dos)
  1341. +if ($Is_MSWin32 || $Is_Dos || $Is_Amiga)
  1342.      {print "ok 29\n";}
  1343.  elsif ($DEV !~ /\nc.* (\S+)\n/)
  1344.      {print "ok 29\n";}
  1345. @@ -171,7 +173,7 @@
  1346.      {print "not ok 33\n";}
  1347.  if (! -b '.') {print "ok 34\n";} else {print "not ok 34\n";}
  1348.  
  1349. -if ($^O eq 'mpeix' or $^O eq 'amigaos' or $Is_Dosish or $Is_Cygwin) {
  1350. +if ($^O eq 'mpeix' or $^O eq 'amigaos' or $^O eq 'morphos' or $Is_Dosish or $Is_Cygwin) {
  1351.    print "ok 35 # skipped: no -u\n"; goto tty_test;
  1352.  }
  1353.  
  1354. @@ -250,7 +252,7 @@
  1355.  
  1356.  open(FOO,'op/stat.t');
  1357.  eval { -T FOO; };
  1358. -if ($@ =~ /not implemented/) {
  1359. +if ($@ =~ /not implemented/ || $@ =~ /Cannot/) {
  1360.      print "# $@";
  1361.      for (45 .. 54) {
  1362.      print "ok $_\n";
  1363. diff -ruN perl-5.6.1-orig/t/op/taint.t perl-5.6.1/t/op/taint.t
  1364. --- perl-5.6.1-orig/t/op/taint.t    Fri Feb 23 02:57:58 2001
  1365. +++ perl-5.6.1/t/op/taint.t    Thu Aug 12 21:28:43 2004
  1366. @@ -142,7 +142,7 @@
  1367.      }
  1368.  
  1369.      my $tmp;
  1370. -    if ($^O eq 'os2' || $^O eq 'amigaos' || $Is_MSWin32 || $Is_Dos) {
  1371. +    if ($^O eq 'os2' || $^O eq 'amigaos' || $^O eq 'morphos' || $Is_MSWin32 || $Is_Dos) {
  1372.      print "# all directories are writeable\n";
  1373.      }
  1374.      else {
  1375. @@ -397,7 +397,7 @@
  1376.  {
  1377.      my $foo = $TAINT;
  1378.  
  1379. -    if ($^O eq 'amigaos') {
  1380. +    if ($^O eq 'amigaos' || $^O eq 'morphos') {
  1381.      for (76..79) { print "ok $_ # Skipped: open('|') is not available\n" }
  1382.      }
  1383.      else {
  1384. diff -ruN perl-5.6.1-orig/utils/c2ph.PL perl-5.6.1/utils/c2ph.PL
  1385. --- perl-5.6.1-orig/utils/c2ph.PL    Fri Feb 23 02:57:58 2001
  1386. +++ perl-5.6.1/utils/c2ph.PL    Sun Aug 29 15:05:38 2004
  1387. @@ -1393,7 +1393,7 @@
  1388.  unlink 'pstruct';
  1389.  print "Linking c2ph to pstruct.\n";
  1390.  if (defined $Config{d_link}) {
  1391. -  link 'c2ph', 'pstruct';
  1392. +  symlink 'c2ph', 'pstruct';
  1393.  } else {
  1394.    unshift @INC, '../lib';
  1395.    require File::Copy;
  1396.